.quick-sort-playground {
  min-height: 100vh;
  background: #f8f9fa;
  padding: 20px 0;
  font-family: 'Microsoft YaHei', Arial, sans-serif;
}

.quick-sort-container {
  display: flex;
  height: 100vh;
  padding: 20px;
  position: relative;
}

/* 拖拽分隔条 */
.resize-handle {
  width: 10px;
  background: transparent;
  cursor: col-resize;
  position: relative;
  flex-shrink: 0;
}

.resize-handle:hover::after,
.resize-handle:active::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #007bff;
  transform: translateX(-50%);
}

/* 右侧动画面板 */
.animation-panel {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.animation-panel h2 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

.animation-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* 数据显示区域 */
.data-display {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 300px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 2px dashed #dee2e6;
  min-width: 100%;
  overflow-x: auto;
}

/* 空状态 */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
  font-size: 16px;
}

/* 数据条形图 */
.quick-data-bar {
  min-width: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.quick-data-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.quick-data-bar .value {
  position: absolute;
  bottom: 5px;
  color: white;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 快速排序特有的样式 */
.quick-data-bar.pivot {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
  z-index: 10;
}

.quick-data-bar.comparing {
  background: linear-gradient(135deg, #48dbfb 0%, #0abde3 100%);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(72, 219, 251, 0.4);
}

.quick-data-bar.swapping {
  background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 6px 16px rgba(254, 202, 87, 0.5);
  animation: swappingPulse 0.6s ease-in-out infinite alternate;
}

.quick-data-bar.left-partition {
  background: linear-gradient(135deg, #a8e6cf 0%, #7fcdcd 100%);
  box-shadow: 0 2px 8px rgba(168, 230, 207, 0.4);
}

.quick-data-bar.right-partition {
  background: linear-gradient(135deg, #ffd3a5 0%, #fd9853 100%);
  box-shadow: 0 2px 8px rgba(255, 211, 165, 0.4);
}

.quick-data-bar.sorted {
  background: linear-gradient(135deg, #00d2d3 0%, #54a0ff 100%);
  box-shadow: 0 2px 8px rgba(0, 210, 211, 0.3);
  animation: sortedGlow 1s ease-in-out;
}

.quick-data-bar.current-range {
  border: 3px solid #ff6b6b;
  border-radius: 6px;
}

/* 动画效果 */
@keyframes swappingPulse {
  0% {
    transform: scale(1.1) translateY(-5px);
  }
  100% {
    transform: scale(1.15) translateY(-10px);
  }
}

@keyframes sortedGlow {
  0% {
    box-shadow: 0 2px 8px rgba(0, 210, 211, 0.3);
  }
  50% {
    box-shadow: 0 4px 16px rgba(0, 210, 211, 0.6);
  }
  100% {
    box-shadow: 0 2px 8px rgba(0, 210, 211, 0.3);
  }
}

/* 分区指示器 */
.partition-indicator {
  position: absolute;
  top: -30px;
  font-size: 12px;
  font-weight: bold;
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.partition-indicator.left {
  color: #7fcdcd;
}

.partition-indicator.right {
  color: #fd9853;
}

.partition-indicator.pivot {
  color: #ff6b6b;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .quick-sort-container {
    flex-direction: column;
    height: auto;
  }
  
  .control-panel {
    width: 100% !important;
    margin-bottom: 20px;
  }
  
  .animation-panel {
    width: 100% !important;
  }
  
  .data-display {
    height: 250px;
  }
}
